#pragma once

#include <vector>
#include <string>
#include <xstring>
#include "structs.h"
#include "constants.h"
#include "gstring.h"

//extern GString xml_name;
extern unsigned char cBitValue;
extern char TypeOfCurrent;
extern char asstyp;
extern bool bReplaceFileChange;
extern bool bStatusByte;
extern bool bContextMenu;
extern bool bTableActive;
extern bool bTableLoaded;
extern bool bDumpToFile;
extern bool bOptimizeBytes;
extern bool bTermNewLine;
extern bool bPadBytes;
extern bool bReplaceToOffset;
extern bool bByteMark;
extern bool bDefByteMark;
extern bool bLastSearchType;
extern bool bFirstSearch;
extern bool bThingyView;
extern bool bCleanScript;
extern bool bReadingTable;
extern bool bDumpClean;
extern bool bJPuncSwitch;
extern bool bJapanese;
extern bool bJPShift;
extern bool bJPEUC;
extern bool bHideHex;
extern bool bInsertMode;
extern bool bSeemsJ;
extern bool bDoingIME;
extern bool bIMEDone;
extern bool bFileRelativeResults;
extern bool bRelativeSearchDone;
extern bool bSplitMultiByte;
extern bool bIsEuc;
extern bool bIsShift;
extern bool bDiscardChangesSave;
extern bool bHighlight;
extern bool bSearchHex;
extern bool bAutomaticXAdjust;
extern bool bAutomaticBPL;
extern bool bOldAutomaticBPL;
extern int iGotoDialogBufLength;
extern int iOpenReadOnlySetting;
extern int iStartPL;
extern int iNumBytesPl;
extern int iPLFileLength;
extern int iRemBookmark;
extern int iBookmarkOffset;
extern int iFindDialogBufLength;
extern int iFindDialogMatchCase;
extern int iFindDialogDirection;
extern int iFindDialogLastLength;
extern int iFindDialogBytecode;
extern int iCopyHexdumpDialogStart;
extern int iCopyHexdumpDialogEnd;
extern int iCopyHexdumpMode;
extern int iDecValDialogOffset;
extern int iDecValDialogValue;
extern int iDecValDialogSize;
extern int iDecValDialogTimes;
extern int iPasteMode;
extern int iPasteMaxTxtLength;
extern int iPasteTimes;
extern int iPasteSkip;
extern int iCutMode;
extern int iOldBPL;
extern int iBPLSetting;
extern int iOffsetLengthSetting;
extern int iAppendbytes;
extern int iManipPos;
extern int iCharacterSetting;
extern int iCharacterSettingSearch;
extern int iFontSizeSetting;
extern int bUnsignedViewSetting;
extern int iDiffNum;
extern int iBinaryModeSetting;
extern int iStartOfSelSetting;
extern int iEndOfSelSetting;
extern int iPasteAsText;
extern int iDestFileLength;
extern int iSrcFileLength;
extern int buflen;
extern int FWFile;
extern int FWFilelen;
extern int tmpstart;
extern int tmpend;
extern int dumps;
extern int inserts;
extern int optimized;
extern int iMaxCharLine;
extern int iLastMaxCharLine;
extern int iLastDumpTarget; 
extern int iBytesPerLine;
extern int iOffsetMode;
extern int SNESHEADER;
//int iOldAutosize = 0;
//int iOldBytesPerLine = 0;
extern int iLastRelativeValue;
extern int iRealTable;
extern long iCutOffset;
extern long iCutNumberOfBytes;
extern long iCopyStartOffset;
extern long iCopyEndOffset;
extern long iIncrementStep;
extern long iProgressPos;
extern long iFileSize;
extern long iDumpStart;
extern long iDumpEnd;
extern bookmark *pbmkRemove;
extern intpair* pdiffChoice;
extern tablevalue tvDakuten;
extern tablevalue tvHandakuten;
extern longpair ppair;
//extern TCHAR cFileName[];
extern TCHAR pcBookmarkTxt[];
extern TCHAR pcFWText[];
extern TCHAR cBuf[];
extern TCHAR szFWFileName[];
extern TCHAR *pcGotoDialogBuffer;
extern TCHAR *pcFindDialogBuffer;
extern TCHAR *pcTmplText;
extern TCHAR *pcPasteText;
extern LONG oldproc;
extern LONG cmdoldproc;
extern COLORREF cTextColor;
extern COLORREF cBkColor;
extern COLORREF cTextColorE;
extern COLORREF cTextColorO;
extern COLORREF cSepColor;
extern COLORREF cSelBkColor;
extern COLORREF cSelTextColor;
extern COLORREF cBookmarkColor;
extern COLORREF cHighlightColor;
extern COLORREF cChangesColor;
extern COLORREF cDTEColor;
extern HFONT hfon;
extern HFONT hfdef;
extern HFONT hfJap;
extern RECT IMEPos;
extern _tstring sLastTableSearch;
extern _tstring sLastTableReplace;
extern _tstring sFileName;
extern _tstring sNull;
extern _tstring sNewLine;
extern _tstring sScriptDump;
extern _tstring sByteOpen;
extern _tstring sByteClose;
extern _tstring sRelSearchString;
extern _tstring sLoadedTable;
extern _tstring sWindowsPath;
extern _tstring sAppPath;
extern _tstring sHexSearchString;
extern _tstring strToReplaceData;
extern _tstring strReplaceWithData;
extern _tstring TxtEditName;
//extern _tstring sBrowserName;
extern std::vector<_tstring> vEmpty;
extern std::vector<_tstring> vHexdoc;
extern std::vector<tablevalue> vEmptyTable;
extern std::vector<scriptdump> vScriptDumps;
extern std::vector<_tstring> vPLineBuf;
extern std::vector<_tstring> vEmptyOB;
extern std::vector<_tstring> vEmptyTB;
extern std::vector<_tstring> vTableOut;
extern std::vector<_tstring> vDualTileTableIn;
extern std::vector<_tstring> vDualByteTableOut;
extern std::vector<_tstring> vTwoByteHighlightTable;
//extern std::vector<tablevalue> vMultiByteTableIn;
extern std::vector<_tstring> vTableIn;
extern std::vector<int> viEmpty;
//extern std::vector<relativescandata> vScanData;
//extern std::vector<relation> vRelativeOffsets;
//extern std::vector<int> vValueList;
//std::vector<std::string> vHighlights;
extern std::vector<linkedvalue> vLinked;
extern std::vector<_tstring> vIMEBytes;
//extern std::vector<_tstring> vTableFileLeft;
//extern std::vector<_tstring> vTableFileRight;
extern std::vector<_tstring> vChanges;
extern std::vector<_tstring> vHighlights;
extern std::vector<_tstring> vDTEs;
extern std::vector<bool> vbEmpty;
extern std::vector<tablevalue> vMultiByteTableOut;
extern HWND hMainWnd;
extern HWND progress1;
extern HWND progress2;
